home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 July / EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso / earcd / dev / c / clib37x.rea < prev    next >
Text File  |  1997-05-03  |  13KB  |  281 lines

  1. Short:    Example.library in 100% C (SAS/Storm/Maxon/...)
  2. Author:   Andreas R. Kleinert, Helmut Hummel, Stefan Fuchs
  3. Uploader: Andreas_Kleinert@t-online.de
  4. Type:     dev/c
  5. Replaces: CExecLib#?.lha
  6.  
  7.  
  8.   example.library V37.10 (6.4.97)
  9.  
  10.   An Amiga shared library in 100 % C language - coming with sources.
  11.  
  12.   Compiler Checklist:        Compiler           Support
  13.                              -------------------------------
  14.    (see README.<compiler>    SAS/C 6.5x         yes
  15.     for more information)    MaxonC 3.x         yes
  16.                              StormC 2.x         yes
  17.                              DICE 3.x           (not tested)
  18.                              GCC 2.7.2.1        yes
  19.                              AztecC             (not tested)
  20.                              vbcc               (not tested)
  21.  
  22.   OS Checklist:              Operating Sustem   Support
  23.                              -------------------------------
  24.                              Amiga OS 37-40     yes
  25.                              AROS 1.x           (not tested)
  26.  
  27.  
  28.   Original SAS/C and StormC version (C) 1996-97 by Andreas R. Kleinert,
  29.   MaxonC version changes done 1996 by Helmut Hummel.
  30.   GCC version changes done 1997 by Stefan Fuchs.
  31.   All rights reserved.
  32.   ----------------------------------------------------------------------
  33.   This sample library intends to make Amiga shared library sources
  34.   compileable with any available Amiga C compiler - without any
  35.   changes to the source code.
  36.   And maybe in the future also running under any Amiga compatible
  37.   operating system with any CPU.
  38.  
  39.   The first goal seams to be easily done: nearly any noticeable compiler
  40.   for the Amiga does support generation of libraries by special
  41.   linker commands and pre-generated object files.
  42.  
  43.   But when looking into the details, one will find out, that these
  44.   linker functionality just reduces the influence of the programmer
  45.   on how his sources are handled, that the pre-generated object
  46.   files just originally were done in Assembler, and that each compiler
  47.   does define its own interface definitions and usage rules.
  48.  
  49.   But as a programmer, it is important to have control over the _complete_
  50.   source code and to be able to compile it _anywhere_ with only
  51.   minor changes, even better without any changes.
  52.  
  53.   Since most Amiga system modules - noticeable Libraries, Devices and
  54.   Resources - do have startup-modules and other larger parts completely
  55.   written in Assembler language, the most important task for getting
  56.   inter-compiler and operating system independant sources in my opinion
  57.   is, to completely migrate the interfaces to C language (but different
  58.   to AROS, for example, it is most important, to keep the sources running
  59.   under the current 68k AmigaOS in the _first_ place).
  60.  
  61.   This goal basically has been reached already, still missing of
  62.   course are some of the less Amiga-native compilers and of course
  63.   tests with any kind of "AmigaOS for PowerPC".
  64.  
  65.   But since Assembler is nearly as portability-hostile as BCPL _today_
  66.   we may come quite close to the goal defined above by just moving
  67.   towards C.
  68.  
  69.   Translate your 68k-assembler library startup-codes smartly
  70.   to C by simply using this source-code as an advice how to do it.
  71.  
  72.   For testing: install the (re)compiled example.library to LIBS: and
  73.   start the test program - it should pop up a requester, then.
  74.  
  75.   If you can submit adjustments for the other compilers as mentioned
  76.   above: feel free to send these.
  77.   ---
  78.   Feel free to use this source for own projects.
  79.  
  80.   It is allowed to be spread and distributed anywhere, as far
  81.   as my consent is concerned.
  82.  
  83.   Amiga International, or the current owner of the technologie,
  84.   is allowed to always put this source on their newest
  85.   Developer CD-ROM.
  86.  
  87.   Thanks and credits will always be appreciated - for example,
  88.   you MAY, but NEED NOT:
  89.   give me credits in your program's docs, send me keyfiles for
  90.   your programs using the library, and so on.
  91.   But that's simply voluntarily.
  92.  
  93.    _________________________________________________________
  94.   |      You may reach me the following way.                |
  95.   |    Send bug-reports, money or whatever to:              |
  96.   |---------------------------------------------------------|
  97.   |        * SuperView Development & Registration *         |
  98.   |          * DRAFU Development & Registration *           |
  99.   |       * Image Engineer Registration Site Europe *       |
  100.   |                                                         |
  101.   |                                                         |
  102.   |                  PerSuaSiVe SoftWorX                    |
  103.   |                                                         |
  104.   |                  Andreas R. Kleinert                    |
  105.   |                  Sandstrasse 1                          |
  106.   |                  D-57072 Siegen                         |
  107.   |                  Germany, Europe                        |
  108.   |                                                         |
  109.   | Any snail mail to the old address will still be routed. |
  110.   |                                                         |
  111.   |                  Phone:  +49-271-22869 also FAX + AM    |
  112.   |                          +49-271-22838                  |
  113.   |                                                         |
  114.   |                  Weekdays after 17.00h.                 |
  115.   |                                                         |
  116.   |         When calling via phone you may leave a message, |
  117.   |         if I'm not available - but don't expect me      |
  118.   |         calling back to USA, Australia, ... since       |
  119.   |         german phone rates are HIGHLY expensive.        |
  120.   |_________________________________________________________|
  121.  
  122.     http://home.t-online.de/home/Andreas_Kleinert/
  123.  
  124.   eMail:
  125.  
  126.         Please send binaries via ARK@COB.wwbnet.de, and keep
  127.         them smaller than 16 KB. Please think twice before
  128.         sending them - my postbox is not unlimited in size.
  129.  
  130.            - Fido    Andreas Kleinert 2:2457/350.18
  131.            - Usenet
  132.                      Andreas_Kleinert@superview.ftn.neckar-alb.de (Fido-Gate)
  133.                      Andreas_Kleinert@t-online.de                 (T-Online)
  134.                      ARK@COB.wwbnet.de                            (Z-Netz)
  135.                      ARK@amigaworld.com                           (AmigaWorld)
  136.  
  137.            - If nothing else works, try one of these public
  138.              Fido-Usenet gateways:
  139.  
  140.                In Germany:
  141.                  Andreas_Kleinert@p18.f350.n2457.z2.fido.sub.org
  142.  
  143.                From USA or elsewhere:
  144.                  Andreas_Kleinert@p18.f350.n2457.z2.fidonet.org
  145.  
  146.         Please note, that the "superview.ftn.sub.org"
  147.         domain will perhaps be renamed soon
  148.  
  149.  
  150.  History:
  151.  
  152.  V37.10 (6.4.97) :  - added GCC version by Stefan Fuchs, snfuchs@sokrates.franken.de.
  153.                       Thanks !
  154.                     - some small changes to docs, includes and comments
  155.                     - still missing: DICE, Aztec, vbcc. Who does it ?
  156.                     - fixed ftn email address
  157.  
  158.  V37.6 (27.3.97) :  - finetuning
  159.  
  160.  V37.5 (24.1.97) :  - rewrote docs
  161.                     - added basic support for compiler independent
  162.                       register naming and SAS/C keyword replacements
  163.                       (compiler.h). Thus sources now should be easily
  164.                       adaptable for GCC as well.
  165.  
  166.  V37.4 (8.1.97) :   - added FD file
  167.                     - added new pragma file (and dir) as
  168.                       include/pragma/example_lib.h
  169.                       which works with Aztec, Maxon, Storm,
  170.                       DICE and SAS C compilers.
  171.                       Thanks to fd2pragma and Dirk Stoecker.
  172.                     - some fixes to the readme files
  173.                     - updated eMail list
  174.  
  175.  V37.3 (3.1.97) :   - slightly changed SCOPTIONS
  176.                     - fixed some style things (APTR and library casts)
  177.                     - changed note about library opening at L_OpenLibs()
  178.                     - now compileable with StormC 2.0 as well
  179.                       (not tested with 1.1) - see readme file for StormC
  180.                     - added project file for StormC 2.0, smakefile still
  181.                       present - select, which one you'd like to use
  182.  
  183.  V37.2 (12.12.96) : - applied some more changes and fixes
  184.                       (-> suggested by Helmut Hummel)
  185.                     - added icons
  186.                       (-> from Helmut Hummel)
  187.  
  188.  V37.1 (4.12.96) : - bumped version to V37
  189.                    - added MaxonC 3.x version by applying changes
  190.                      to the SAS/C sources and adding Maxon
  191.                      specific make and configuration files
  192.                      (-> all done by Helmut Hummel, see Readme.MAXON)
  193.                    - added StormC support
  194.                    - yet missing: DICE, Aztec, GNU. Who does it ?
  195.  
  196.  V1.4 (30.11.96) : - added SAS/C specific Ctrl-C disabling code
  197.                    - made some workarounds compiler sensitive
  198.                    - redone all with SAS/C V6.57
  199.                    - 944 Bytes ;-)
  200.  
  201.  V1.3 (13.9.96) :  - when starting lib as executable, -1 must be returned
  202.                    - now caching SysBase
  203.                    - added some comments, where changes should not
  204.                      be applied
  205.                    - added note about sharing library bases
  206.                    - documented and modified sample function,
  207.                      so that correct a0/a1/d0/d1 and a6 usage becomes
  208.                      more obviously and verbose
  209.                    - still 940 bytes ;-)
  210.  
  211.  V1.2 (5.9.96)  :  - fixed some things resulting out of a
  212.                      discussion in Z-Netz
  213.  
  214.  V1.1 (1.9.96)  :  - small changes in style
  215.                      (only bumped versions of changed modules):
  216.                        o moved "examplebase.h" to include/example/
  217.                          (so also adjusted LibInit.c, StartUp.c
  218.                           and SCOPTIONS for reflecting that)
  219.                        o SampleFuncs.h did contain wrong prototype
  220.                          (did not matter, since only used for
  221.                           ULONG function table within StartUp.c)
  222.                        o explicitely __aligned ROMTag structure
  223.  
  224.  V1.0 (14.8.96) : - first release
  225.  
  226.  
  227.  ---
  228.  All mentioned trademarks are subjects to their owners.
  229.  
  230.  
  231. ============================= Archive contents =============================
  232.  
  233. Original  Packed Ratio    Date     Time    Name
  234. -------- ------- ----- --------- --------  -------------
  235.     1720     433 74.8% 11-Dec-96 15:39:54 +bin.info
  236.     5248    3480 33.6% 05-Dec-96 11:46:22 +TestExampleLib
  237.      450     230 48.8% 11-Dec-96 15:49:34 +TestExampleLib.info
  238.      860     589 31.5% 01-Apr-97 11:38:26 +example.library
  239.     1884     861 54.2% 01-Apr-97 11:27:18 +ReadMe.GCC
  240.     1201     683 43.1% 25-Jan-97 10:21:22 +ReadMe.MAXON
  241.      486     280 42.3% 27-Mar-97 10:33:08 +ReadMe.SAS
  242.      915     480 47.5% 25-Jan-97 10:21:12 +ReadMe.STORM
  243.    10126    3653 63.9% 06-Apr-97 11:24:58 +ReadMe_First
  244.     1720     433 74.8% 11-Dec-96 15:39:56 +source.info
  245.      125     117  6.4% 08-Jan-97 19:09:50 +example.fd
  246.      425     247 41.8% 05-Dec-96 11:45:24 +example_protos.h
  247.      289     185 35.9% 05-Dec-96 11:44:58 +example.h
  248.      654     319 51.2% 11-Dec-96 15:00:22 +examplebase.h
  249.      477     247 48.2% 08-Jan-97 19:10:26 +example_lib.h
  250.      311     207 33.4% 05-Dec-96 11:45:38 +example_pragmas.h
  251.      330     207 37.2% 05-Dec-96 11:45:50 +example.h
  252.     1720     433 74.8% 11-Dec-96 15:39:42 +lib_source.info
  253.     3811    1234 67.6% 01-Apr-97 11:33:26 +compiler.h
  254.      860     589 31.5% 01-Apr-97 11:38:24 +example.library
  255.     3354    1278 61.8% 01-Apr-97 11:36:52 +LibInit.c
  256.      888     542 38.9% 01-Apr-97 11:38:14 +LibInit.o
  257.       25      25  0.0% 05-Dec-96 12:07:46 +make_storm.bat
  258.      487     240 50.7% 01-Apr-97 11:27:18 +makefile.gcc
  259.      419     164 60.8% 11-Dec-96 15:31:14 +makefile.MAXON
  260.      347     232 33.1% 05-Dec-96 11:36:28 +makefile.MAXON.info
  261.      381     232 39.1% 05-Dec-96 11:36:28 +mcpp.SESSION
  262.     1596     827 48.1% 01-Apr-97 11:36:46 +SampleFuncs.c
  263.      375     249 33.6% 01-Apr-97 11:27:18 +SampleFuncs.h
  264.      216     194 10.1% 01-Apr-97 11:38:24 +SampleFuncs.o
  265.      128     105 17.9% 03-Jan-97 15:29:36 +SCOPTIONS
  266.      395     148 62.5% 05-Dec-96 11:36:28 +smakefile
  267.       95      85 10.5% 05-Dec-96 11:36:28 +smakefile.wth
  268.     4618    1473 68.1% 01-Apr-97 11:37:06 +StartUp.c
  269.      788     483 38.7% 01-Apr-97 11:38:10 +StartUp.o
  270.     1757     595 66.1% 03-Jan-97 15:44:56 +storm_project.¶
  271.      624     350 43.9% 03-Jan-97 15:44:56 +storm_project.¶.info
  272.      622     269 56.7% 03-Jan-97 15:44:30 +storm_smakefile
  273.      119     100 15.9% 05-Dec-96 11:36:28 +SCOPTIONS
  274.      256     105 58.9% 05-Dec-96 11:36:28 +smakefile
  275.     5248    3480 33.6% 05-Dec-96 11:46:22 +TestExampleLib
  276.      673     374 44.4% 05-Dec-96 11:46:12 +TestExampleLib.c
  277.      835     394 52.8% 05-Dec-96 11:36:28 +TestExampleLib.info
  278.      300     242 19.3% 05-Dec-96 11:46:20 +TestExampleLib.o
  279. -------- ------- ----- --------- --------
  280.    58158   27093 53.4% 06-Apr-97 23:29:00   44 files
  281.